package com.tarzan.mybatis.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liujinshan
 * @title: MybatisPlusConfiguration
 * @projectName com.tarzan.common.core.config
 * @description: TODO
 * @date 2021/5/24 15:39*/


@Configuration
@MapperScan("com.tarzan.**.dao.**")
public class MybatisPlusConfiguration {

    
    /**
     * @title mybatisPlusInterceptor
     * @description TODO 分页插件
     * @param 
     * @return com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor 
     * @author liujinshan
     * @data 2021/7/20 8:21
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }


}
